<?php

namespace apiend\modules\shop\models;

use Yii;
use yii\data\ActiveDataProvider;

/**
 * This is the model class for table "{{%dynamic}}".
 *
 * @property int $id
 * @property string $user_id 用户ID
 * @property string $content
 * @property int $direction 动态类型：0主动动态，1被动动态
 * @property int $retweet_id 转发动态原始ID
 * @property int $status
 * @property string $created_at
 * @property string $updated_at
 * @property string $deleted_at
 */
class AttachmentSearch extends \common\models\shop\ShopAttachment {

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $id
     *
     * @return ActiveDataProvider
     */
    public static function search($id) {
        $model = static::findOne($id);
        return $albums = $model->album;
    }

    public function fields() {
        return [
            'id',
            'name',
            'slogan',
            'description' => function() {
                return '搭配米家多功能网关 / 智能探测人或宠物移动';
            },
            'cover',
            'price',
            'tag',
        ];
    }

}
